<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
    "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="generator" content="AsciiDoc 8.5.2" />
<title>Gerrit Code Review - Quick get started guide</title>
<style type="text/css">
/* Debug borders */
p, li, dt, dd, div, pre, h1, h2, h3, h4, h5, h6 {
/*
  border: 1px solid red;
*/
}

body {
  margin: 1em 5% 1em 5%;
}

a {
  color: blue;
  text-decoration: underline;
}
a:visited {
  color: fuchsia;
}

em {
  font-style: italic;
  color: navy;
}

strong {
  font-weight: bold;
  color: #083194;
}

tt {
  color: navy;
}

h1, h2, h3, h4, h5, h6 {
  color: #527bbd;
  font-family: sans-serif;
  margin-top: 1.2em;
  margin-bottom: 0.5em;
  line-height: 1.3;
}

h1, h2, h3 {
  border-bottom: 2px solid silver;
}
h2 {
  padding-top: 0.5em;
}
h3 {
  float: left;
}
h3 + * {
  clear: left;
}

div.sectionbody {
  font-family: serif;
  margin-left: 0;
}

hr {
  border: 1px solid silver;
}

p {
  margin-top: 0.5em;
  margin-bottom: 0.5em;
}

ul, ol, li > p {
  margin-top: 0;
}

pre {
  padding: 0;
  margin: 0;
}

span#author {
  color: #527bbd;
  font-family: sans-serif;
  font-weight: bold;
  font-size: 1.1em;
}
span#email {
}
span#revnumber, span#revdate, span#revremark {
  font-family: sans-serif;
}

div#footer {
  font-family: sans-serif;
  font-size: small;
  border-top: 2px solid silver;
  padding-top: 0.5em;
  margin-top: 4.0em;
}
div#footer-text {
  float: left;
  padding-bottom: 0.5em;
}
div#footer-badges {
  float: right;
  padding-bottom: 0.5em;
}

div#preamble {
  margin-top: 1.5em;
  margin-bottom: 1.5em;
}
div.tableblock, div.imageblock, div.exampleblock, div.verseblock,
div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock,
div.admonitionblock {
  margin-top: 1.0em;
  margin-bottom: 1.5em;
}
div.admonitionblock {
  margin-top: 2.0em;
  margin-bottom: 2.0em;
  margin-right: 10%;
  color: #606060;
}

div.content { /* Block element content. */
  padding: 0;
}

/* Block element titles. */
div.title, caption.title {
  color: #527bbd;
  font-family: sans-serif;
  font-weight: bold;
  text-align: left;
  margin-top: 1.0em;
  margin-bottom: 0.5em;
}
div.title + * {
  margin-top: 0;
}

td div.title:first-child {
  margin-top: 0.0em;
}
div.content div.title:first-child {
  margin-top: 0.0em;
}
div.content + div.title {
  margin-top: 0.0em;
}

div.sidebarblock > div.content {
  background: #ffffee;
  border: 1px solid silver;
  padding: 0.5em;
}

div.listingblock > div.content {
  border: 1px solid silver;
  background: #f4f4f4;
  padding: 0.5em;
}

div.quoteblock, div.verseblock {
  padding-left: 1.0em;
  margin-left: 1.0em;
  margin-right: 10%;
  border-left: 5px solid #dddddd;
  color: #777777;
}

div.quoteblock > div.attribution {
  padding-top: 0.5em;
  text-align: right;
}

div.verseblock > div.content {
  white-space: pre;
}
div.verseblock > div.attribution {
  padding-top: 0.75em;
  text-align: left;
}
/* DEPRECATED: Pre version 8.2.7 verse style literal block. */
div.verseblock + div.attribution {
  text-align: left;
}

div.admonitionblock .icon {
  vertical-align: top;
  font-size: 1.1em;
  font-weight: bold;
  text-decoration: underline;
  color: #527bbd;
  padding-right: 0.5em;
}
div.admonitionblock td.content {
  padding-left: 0.5em;
  border-left: 3px solid #dddddd;
}

div.exampleblock > div.content {
  border-left: 3px solid #dddddd;
  padding-left: 0.5em;
}

div.imageblock div.content { padding-left: 0; }
span.image img { border-style: none; }
a.image:visited { color: white; }

dl {
  margin-top: 0.8em;
  margin-bottom: 0.8em;
}
dt {
  margin-top: 0.5em;
  margin-bottom: 0;
  font-style: normal;
  color: navy;
}
dd > *:first-child {
  margin-top: 0.1em;
}

ul, ol {
    list-style-position: outside;
}
ol.arabic {
  list-style-type: decimal;
}
ol.loweralpha {
  list-style-type: lower-alpha;
}
ol.upperalpha {
  list-style-type: upper-alpha;
}
ol.lowerroman {
  list-style-type: lower-roman;
}
ol.upperroman {
  list-style-type: upper-roman;
}

div.compact ul, div.compact ol,
div.compact p, div.compact p,
div.compact div, div.compact div {
  margin-top: 0.1em;
  margin-bottom: 0.1em;
}

div.tableblock > table {
  border: 3px solid #527bbd;
}
thead, p.table.header {
  font-family: sans-serif;
  font-weight: bold;
}
tfoot {
  font-weight: bold;
}
td > div.verse {
  white-space: pre;
}
p.table {
  margin-top: 0;
}
/* Because the table frame attribute is overriden by CSS in most browsers. */
div.tableblock > table[frame="void"] {
  border-style: none;
}
div.tableblock > table[frame="hsides"] {
  border-left-style: none;
  border-right-style: none;
}
div.tableblock > table[frame="vsides"] {
  border-top-style: none;
  border-bottom-style: none;
}


div.hdlist {
  margin-top: 0.8em;
  margin-bottom: 0.8em;
}
div.hdlist tr {
  padding-bottom: 15px;
}
dt.hdlist1.strong, td.hdlist1.strong {
  font-weight: bold;
}
td.hdlist1 {
  vertical-align: top;
  font-style: normal;
  padding-right: 0.8em;
  color: navy;
}
td.hdlist2 {
  vertical-align: top;
}
div.hdlist.compact tr {
  margin: 0;
  padding-bottom: 0;
}

.comment {
  background: yellow;
}

.footnote, .footnoteref {
  font-size: 0.8em;
}

span.footnote, span.footnoteref {
  vertical-align: super;
}

#footnotes {
  margin: 20px 0 20px 0;
  padding: 7px 0 0 0;
}

#footnotes div.footnote {
  margin: 0 0 5px 0;
}

#footnotes hr {
  border: none;
  border-top: 1px solid silver;
  height: 1px;
  text-align: left;
  margin-left: 0;
  width: 20%;
  min-width: 100px;
}


@media print {
  div#footer-badges { display: none; }
}

div#toc {
  margin-bottom: 2.5em;
}

div#toctitle {
  color: #527bbd;
  font-family: sans-serif;
  font-size: 1.1em;
  font-weight: bold;
  margin-top: 1.0em;
  margin-bottom: 0.1em;
}

div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 {
  margin-top: 0;
  margin-bottom: 0;
}
div.toclevel2 {
  margin-left: 2em;
  font-size: 0.9em;
}
div.toclevel3 {
  margin-left: 4em;
  font-size: 0.9em;
}
div.toclevel4 {
  margin-left: 6em;
  font-size: 0.9em;
}
/* Workarounds for IE6's broken and incomplete CSS2. */

div.sidebar-content {
  background: #ffffee;
  border: 1px solid silver;
  padding: 0.5em;
}
div.sidebar-title, div.image-title {
  color: #527bbd;
  font-family: sans-serif;
  font-weight: bold;
  margin-top: 0.0em;
  margin-bottom: 0.5em;
}

div.listingblock div.content {
  border: 1px solid silver;
  background: #f4f4f4;
  padding: 0.5em;
}

div.quoteblock-attribution {
  padding-top: 0.5em;
  text-align: right;
}

div.verseblock-content {
  white-space: pre;
}
div.verseblock-attribution {
  padding-top: 0.75em;
  text-align: left;
}

div.exampleblock-content {
  border-left: 3px solid #dddddd;
  padding-left: 0.5em;
}

/* IE6 sets dynamically generated links as visited. */
div#toc a:visited { color: blue; }
</style>
<script type="text/javascript">
/*<![CDATA[*/
window.onload = function(){asciidoc.footnotes(); asciidoc.toc(2);}
var asciidoc = {  // Namespace.

/////////////////////////////////////////////////////////////////////
// Table Of Contents generator
/////////////////////////////////////////////////////////////////////

/* Author: Mihai Bazon, September 2002
 * http://students.infoiasi.ro/~mishoo
 *
 * Table Of Content generator
 * Version: 0.4
 *
 * Feel free to use this script under the terms of the GNU General Public
 * License, as long as you do not remove or alter this notice.
 */

 /* modified by Troy D. Hanson, September 2006. License: GPL */
 /* modified by Stuart Rackham, 2006, 2009. License: GPL */

// toclevels = 1..4.
toc: function (toclevels) {

  function getText(el) {
    var text = "";
    for (var i = el.firstChild; i != null; i = i.nextSibling) {
      if (i.nodeType == 3 /* Node.TEXT_NODE */) // IE doesn't speak constants.
        text += i.data;
      else if (i.firstChild != null)
        text += getText(i);
    }
    return text;
  }

  function TocEntry(el, text, toclevel) {
    this.element = el;
    this.text = text;
    this.toclevel = toclevel;
  }

  function tocEntries(el, toclevels) {
    var result = new Array;
    var re = new RegExp('[hH]([2-'+(toclevels+1)+'])');
    // Function that scans the DOM tree for header elements (the DOM2
    // nodeIterator API would be a better technique but not supported by all
    // browsers).
    var iterate = function (el) {
      for (var i = el.firstChild; i != null; i = i.nextSibling) {
        if (i.nodeType == 1 /* Node.ELEMENT_NODE */) {
          var mo = re.exec(i.tagName);
          if (mo && (i.getAttribute("class") || i.getAttribute("className")) != "float") {
            result[result.length] = new TocEntry(i, getText(i), mo[1]-1);
          }
          iterate(i);
        }
      }
    }
    iterate(el);
    return result;
  }

  var toc = document.getElementById("toc");
  var entries = tocEntries(document.getElementById("content"), toclevels);
  for (var i = 0; i < entries.length; ++i) {
    var entry = entries[i];
    if (entry.element.id == "")
      entry.element.id = "_toc_" + i;
    var a = document.createElement("a");
    a.href = "#" + entry.element.id;
    a.appendChild(document.createTextNode(entry.text));
    var div = document.createElement("div");
    div.appendChild(a);
    div.className = "toclevel" + entry.toclevel;
    toc.appendChild(div);
  }
  if (entries.length == 0)
    toc.parentNode.removeChild(toc);
},


/////////////////////////////////////////////////////////////////////
// Footnotes generator
/////////////////////////////////////////////////////////////////////

/* Based on footnote generation code from:
 * http://www.brandspankingnew.net/archive/2005/07/format_footnote.html
 */

footnotes: function () {
  var cont = document.getElementById("content");
  var noteholder = document.getElementById("footnotes");
  var spans = cont.getElementsByTagName("span");
  var refs = {};
  var n = 0;
  for (i=0; i<spans.length; i++) {
    if (spans[i].className == "footnote") {
      n++;
      // Use [\s\S] in place of . so multi-line matches work.
      // Because JavaScript has no s (dotall) regex flag.
      note = spans[i].innerHTML.match(/\s*\[([\s\S]*)]\s*/)[1];
      noteholder.innerHTML +=
        "<div class='footnote' id='_footnote_" + n + "'>" +
        "<a href='#_footnoteref_" + n + "' title='Return to text'>" +
        n + "</a>. " + note + "</div>";
      spans[i].innerHTML =
        "[<a id='_footnoteref_" + n + "' href='#_footnote_" + n +
        "' title='View footnote' class='footnote'>" + n + "</a>]";
      var id =spans[i].getAttribute("id");
      if (id != null) refs["#"+id] = n;
    }
  }
  if (n == 0)
    noteholder.parentNode.removeChild(noteholder);
  else {
    // Process footnoterefs.
    for (i=0; i<spans.length; i++) {
      if (spans[i].className == "footnoteref") {
        var href = spans[i].getElementsByTagName("a")[0].getAttribute("href");
        href = href.match(/#.*/)[0];  // Because IE return full URL.
        n = refs[href];
        spans[i].innerHTML =
          "[<a href='#_footnote_" + n +
          "' title='View footnote' class='footnote'>" + n + "</a>]";
      }
    }
  }
}

}
/*]]>*/
</script>
</head>
<body>
<div id="header">
<h1>Gerrit Code Review - Quick get started guide</h1>
<span id="revnumber">version 2.3</span>
<div id="toc">
  <div id="toctitle">Table of Contents</div>
  <noscript><p><b>JavaScript must be enabled in your browser to display the table of contents.</b></p></noscript>
</div>
</div>
<div id="content">
<div id="preamble">
<div class="sectionbody">
<div class="sidebarblock">
<div class="sidebar-content">
<div class="paragraph"><p>This guide was made with the impatient in mind, ready to try out Gerrit on their
own server but not prepared to make the full installation procedure yet.</p></div>
<div class="paragraph"><p>Explanation is sparse and you should not use a server installed this way in a
live setup, this is made with proof of concept activities in mind.</p></div>
<div class="paragraph"><p>It is presumed you install it on a Unix based server such as any of the Linux
flavors or BSD.</p></div>
<div class="paragraph"><p>It&#8217;s also presumed that you have access to an OpenID enabled email address.
Examples of OpenID enable email providers are gmail, yahoo and hotmail.
It&#8217;s also possible to register a custom email address with OpenID, but that is
outside the scope of this quick installation guide. For testing purposes one of
the above providers should be fine. Please note that network access to the
OpenID provider you choose is necessary for both you and your Gerrit instance.</p></div>
</div></div>
</div>
</div>
<h2 id="requirements">Requirements</h2>
<div class="sectionbody">
<div class="paragraph"><p>Most distributions come with Java today. Do you already have Java installed?</p></div>
<div class="listingblock">
<div class="content">
<pre><tt>  $ java -version
  java version "1.6.0_26"
  Java(TM) SE Runtime Environment (build 1.6.0_26-b03-384-10M3425)
  Java HotSpot(TM) 64-Bit Server VM (build 20.1-b02-384, mixed mode)</tt></pre>
</div></div>
<div class="paragraph"><p>If Java isn&#8217;t installed, get it:</p></div>
<div class="ulist"><ul>
<li>
<p>
JDK, minimum version 1.6 <a href="http://www.oracle.com/technetwork/java/javase/downloads/index.html">Download</a>
</p>
</li>
</ul></div>
</div>
<h2 id="user">Create a user to host the Gerrit service</h2>
<div class="sectionbody">
<div class="paragraph"><p>We will run the service as a non privileged user on your system.
First create the user and then become the user:</p></div>
<div class="listingblock">
<div class="content">
<pre><tt>  $ sudo adduser gerrit2
  $ sudo su gerrit2</tt></pre>
</div></div>
<div class="paragraph"><p>If you don&#8217;t have root privileges you could skip this step and run gerrit
as your own user as well.</p></div>
</div>
<h2 id="download">Download Gerrit</h2>
<div class="sectionbody">
<div class="paragraph"><p>It&#8217;s time to download the archive that contains the gerrit web and ssh service.</p></div>
<div class="paragraph"><p>You can choose from different versions to download from here:</p></div>
<div class="ulist"><ul>
<li>
<p>
<a href="http://code.google.com/p/gerrit/downloads/list">A list of releases available</a>
</p>
</li>
</ul></div>
<div class="paragraph"><p>This tutorial is based on version 2.2.2, and you can download that from this link</p></div>
<div class="ulist"><ul>
<li>
<p>
<a href="http://code.google.com/p/gerrit/downloads/detail?name=gerrit-2.2.2.war">Link to the 2.2.2 war archive</a>
</p>
</li>
</ul></div>
</div>
<h2 id="initialization">Initialize the Site</h2>
<div class="sectionbody">
<div class="paragraph"><p>It&#8217;s time to run the initialization, and with the batch switch enabled, we don&#8217;t have to answer any questions at all:</p></div>
<div class="listingblock">
<div class="content">
<pre><tt>  gerrit2@host:~$ java -jar gerrit.war init --batch -d ~/gerrit_testsite
  Generating SSH host key ... rsa(simple)... done
  Initialized /home/gerrit2/gerrit_testsite
  Executing /home/gerrit2/gerrit_testsite/bin/gerrit.sh start
  Starting Gerrit Code Review: OK
  gerrit2@host:~$</tt></pre>
</div></div>
<div class="paragraph"><p>When the init is complete, you can review your settings in the
file <tt>'$site_path/etc/gerrit.config'</tt>.</p></div>
<div class="paragraph"><p>An important setting will be the canonicalWebUrl which will
be needed later to access gerrit&#8217;s web interface.</p></div>
<div class="listingblock">
<div class="content">
<pre><tt>  gerrit2@host:~$ cat ~/gerrit_testsite/etc/gerrit.config | grep canonical
  canonicalWebUrl = http://localhost:8080/
  gerrit2@host:~$</tt></pre>
</div></div>
</div>
<h2 id="usersetup">The first user</h2>
<div class="sectionbody">
<div class="paragraph"><p>It&#8217;s time to exit the gerrit2 account as you now have Gerrit running on your
host and setup your first workspace.</p></div>
<div class="paragraph"><p>Start a shell with the credentials of the account you will perform
development under.</p></div>
<div class="paragraph"><p>Check whether there are any ssh keys already. You&#8217;re looking for two files,
id_rsa and id_rsa.pub.</p></div>
<div class="listingblock">
<div class="content">
<pre><tt>  user@host:~$ ls .ssh
  authorized_keys  config  id_rsa  id_rsa.pub  known_hosts
  user@host:~$</tt></pre>
</div></div>
<div class="paragraph"><p>If you have the files, you may skip the key generating step.</p></div>
<div class="paragraph"><p>If you don&#8217;t see the files in your listing, your will have to generate rsa
keys for your ssh sessions:</p></div>
<h3 id="_ssh_key_generation">SSH key generation</h3><div style="clear:left"></div>
<div class="paragraph"><p><strong>Please don&#8217;t generate new keys if you already have a valid keypair!</strong>
<strong>They will be overwritten!</strong></p></div>
<div class="listingblock">
<div class="content">
<pre><tt>  user@host:~$ ssh-keygen -t rsa
  Generating public/private rsa key pair.
  Enter file in which to save the key (/home/user/.ssh/id_rsa):
  Created directory '/home/user/.ssh'.
  Enter passphrase (empty for no passphrase):
  Enter same passphrase again:
  Your identification has been saved in /home/user/.ssh/id_rsa.
  Your public key has been saved in /home/user/.ssh/id_rsa.pub.
  The key fingerprint is:
  00:11:22:00:11:22:00:11:44:00:11:22:00:11:22:99 user@host
  The key's randomart image is:
  +--[ RSA 2048]----+
  |     ..+.*=+oo.*E|
  |      u.OoB.. . +|
  |       ..*.      |
  |       o         |
  |      . S ..     |
  |                 |
  |                 |
  |          ..     |
  |                 |
  +-----------------+
  user@host:~$</tt></pre>
</div></div>
<h3 id="_registering_your_key_in_gerrit">Registering your key in Gerrit</h3><div style="clear:left"></div>
<div class="paragraph"><p>Open a browser and enter the canonical url you got before when
initializing Gerrit.</p></div>
<div class="listingblock">
<div class="content">
<pre><tt>  Canonical URL                [http://localhost:8080/]:</tt></pre>
</div></div>
<div class="paragraph"><p>Register a new account in Gerrit through the web interface with the
email address of your choice.
The first user to sign-in and register an account will be
automatically placed into the fully privileged Administrators group,
permitting server management over the web and over SSH.  Subsequent
users will be automatically registered as unprivileged users.</p></div>
<div class="paragraph"><p>Once signed in as your user, you find a little wizard to get you started.
The wizard helps you fill out:</p></div>
<div class="ulist"><ul>
<li>
<p>
Real name (visible name in Gerrit)
</p>
</li>
<li>
<p>
Register your email (it must be confirmed later)
</p>
</li>
<li>
<p>
Select a username with which to communicate with Gerrit over ssh+git
</p>
</li>
<li>
<p>
The server will ask you for an RSA public key.
That&#8217;s the key we generated above, and it&#8217;s time to make sure that Gerrit knows
about our new key and can identify us by it.
</p>
</li>
</ul></div>
<div class="listingblock">
<div class="content">
<pre><tt>  user@host:~$ cat .ssh/id_rsa.pub
  ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA5E785mWtMckorP5v40PyFeui9T50dKpaGYw67Mlv2J3aGBG3tS0qBQxKEpiV0J4+W0RgQHbWfNqdUYen9bC5VVH/GatYWkpL9TjjUcHzF1rX3Eyv7PHuHLAyd/8Zdv6R3saF+hNpp1JW0BSa7HXzK7iNCVA3kBuBthxeGh3OoFbaXHn1zwwVQw8I5+Lp9OOIY7sJEsM/kW699XDV6z2zlkByNVEp45j+g26x5rCnGS8GJM7A0uHsaWJddO6TiyR6/2SOBF1VtKw49XLTQcmDInFAZzUsAZSDKlfYloPkpA6YdqeG0eJqau+jtzuigydoVj4j9xidcJ9HtxZcJNuraw== user@host
  user@host:~$</tt></pre>
</div></div>
<div class="paragraph"><p>Copy the string starting with ssh-rsa to your clipboard and then paste it
into the box for RSA keys. Make <strong>absolutely sure</strong> no extra spaces or line feeds
are entered in the middle of the RSA string.</p></div>
<div class="paragraph"><p>Verify that the ssh connection works for you.</p></div>
<div class="listingblock">
<div class="content">
<pre><tt>  user@host:~$ ssh user@localhost -p 29418
  The authenticity of host '[localhost]:29418 ([127.0.0.1]:29418)' can't be established.
  RSA key fingerprint is db:07:3d:c2:94:25:b5:8d:ac:bc:b5:9e:2f:95:5f:4a.
  Are you sure you want to continue connecting (yes/no)? yes
  Warning: Permanently added '[localhost]:29418' (RSA) to the list of known hosts.

  ****    Welcome to Gerrit Code Review    ****

  Hi user, you have successfully connected over SSH.

  Unfortunately, interactive shells are disabled.
  To clone a hosted Git repository, use:

  git clone ssh://user@localhost:29418/REPOSITORY_NAME.git

  user@host:~$</tt></pre>
</div></div>
</div>
<h2 id="_project_creation">Project creation</h2>
<div class="sectionbody">
<div class="paragraph"><p>Your base Gerrit server is now running and you have a user that&#8217;s ready
to interact with it.  You now have two options, either you create a new
test project to work with or you already have a git with history that
you would like to import into gerrit and try out code review on.</p></div>
<h3 id="_new_project_from_scratch">New project from scratch</h3><div style="clear:left"></div>
<div class="paragraph"><p>If you choose to create a new repository from scratch, it&#8217;s easier for
you to create a project with an initial commit in it. That way first
time setup between client and server is easier.</p></div>
<div class="paragraph"><p>This is done via the SSH port:</p></div>
<div class="listingblock">
<div class="content">
<pre><tt>  user@host:~$ ssh -p 29418 user@localhost gerrit create-project --empty-commit --name demo-project
  user@host:~$</tt></pre>
</div></div>
<div class="paragraph"><p>This will create a repository that you could clone to work with.</p></div>
<h3 id="_already_existing_project">Already existing project</h3><div style="clear:left"></div>
<div class="paragraph"><p>The other alternative is if you already have a git project that you
want to try out Gerrit on.
First you have to create the project, this is done via the SSH port:</p></div>
<div class="listingblock">
<div class="content">
<pre><tt>  user@host:~$ ssh -p 29418 user@localhost gerrit create-project --name demo-project
  user@host:~$</tt></pre>
</div></div>
<div class="paragraph"><p>You need to make sure that at least initially your account is granted
"Create Reference" privileges for the refs/heads/* reference.
This is done via the web interface in the Admin/Projects/Access page
that correspond to your project.</p></div>
<div class="paragraph"><p>After that it&#8217;s time to upload the previous history to the server:</p></div>
<div class="listingblock">
<div class="content">
<pre><tt>  user@host:~/my-project$ git push ssh://user@localhost:29418/demo-project *:*
  Counting objects: 2011, done.
  Writing objects: 100% (2011/2011), 456293 bytes, done.
  Total 2011 (delta 0), reused 0 (delta 0)
  To ssh://user@localhost:29418/demo-project
   * [new branch]      master -&gt; master
  user@host:~/my-project$</tt></pre>
</div></div>
<div class="paragraph"><p>This will create a repository that you could clone to work with.</p></div>
</div>
<h2 id="_my_first_change">My first change</h2>
<div class="sectionbody">
<div class="paragraph"><p>Download a local clone of the repository and move into it</p></div>
<div class="listingblock">
<div class="content">
<pre><tt>  user@host:~$ git clone ssh://user@host:29418/demo-project
  Cloning into demo-project...
  remote: Counting objects: 2, done
  remote: Finding sources: 100% (2/2)
  remote: Total 2 (delta 0), reused 0 (delta 0)
  user@host:~$ cd demo-project
  user@host:~/demo-project$</tt></pre>
</div></div>
<div class="paragraph"><p>Then make a change to it and upload it as a reviewable change in Gerrit.</p></div>
<div class="listingblock">
<div class="content">
<pre><tt>  user@host:~/demo-project$ date &gt; testfile.txt
  user@host:~/demo-project$ git add testfile.txt
  user@host:~/demo-project$ git commit -m "My pretty test commit"
  [master ff643a5] My pretty test commit
   1 files changed, 1 insertions(+), 0 deletions(-)
   create mode 100644 testfile.txt
  user@host:~/demo-project$</tt></pre>
</div></div>
<div class="paragraph"><p>Usually when you push to a remote git, you push to the reference
<tt>'/refs/heads/branch'</tt>, but when working with Gerrit you have to push to a
virtual branch representing "code review before submittal to branch".
This virtual name space is known as /refs/for/&lt;branch&gt;</p></div>
<div class="listingblock">
<div class="content">
<pre><tt>  user@host:~/demo-project$ git push origin HEAD:refs/for/master
  Counting objects: 4, done.
  Writing objects: 100% (3/3), 293 bytes, done.
  Total 3 (delta 0), reused 0 (delta 0)
  remote:
  remote: New Changes:
  remote:   http://localhost:8080/1
  remote:
  To ssh://user@localhost:29418/demo-project
   * [new branch]      HEAD -&gt; refs/for/master
  user@host:~/demo-project$</tt></pre>
</div></div>
<div class="paragraph"><p>You should now be able to access your change by browsing to the http URL
suggested above, <a href="http://localhost:8080/1">http://localhost:8080/1</a></p></div>
</div>
<h2 id="_quick_installation_complete">Quick Installation Complete</h2>
<div class="sectionbody">
<div class="paragraph"><p>This covers the scope of getting Gerrit started and your first change uploaded.
It doesn&#8217;t give any clue as to how the review workflow works, please find
<a href="http://source.android.com/submit-patches/workflow">Default Workflow</a> to
learn more about the workflow of Gerrit.</p></div>
<div class="paragraph"><p>To read more on the installation of Gerrit please read <a href="install.html">the detailed
installation page</a>.</p></div>
</div>
<hr style="
  height: 2px;
  color: silver;
  margin-top: 1.2em;
  margin-bottom: 0.5em;
">
<div class="paragraph"><p>Part of <a href="index.html">Gerrit Code Review</a></p></div>
</div>
<div id="footnotes"><hr /></div>
<div id="footer">
<div id="footer-text">
Version 2.3<br />
Last updated 2012-03-07 11:57:26 MDT
</div>
</div>
</body>
</html>
